import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import analyze from "rollup-plugin-analyzer";

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue()],
    define: {},
    build: {
        terserOptions: {
            // 生产环境下移除console
            compress: {
                drop_console: true,
                drop_debugger: true,
            },
        },
        lib: {
            entry: "./src/index.vue",
            name: "VueMonacoEditor",
            fileName: "index",
            formats: ["es"],
        },
        rollupOptions: {
            external: ["vue"],
            output: { globals: { vue: "Vue" } },
            plugins: [analyze()],
        },
    },
});
